#include "AudioWorld.h"

AudioWorld::AudioWorld()
{
    Init();
}

void AudioWorld::Destroy()
{
    alcMakeContextCurrent(NULL);
    alcDestroyContext(m_Context);
    alcCloseDevice(m_Device);

}

bool AudioWorld::Init()
{
    m_Device = alcOpenDevice(NULL);

    if (!m_Device) {
        return false;
    }

    m_Context = alcCreateContext(m_Device, NULL);
    alcMakeContextCurrent(m_Context);

    return m_Device;
}

AudioWorld::~AudioWorld()
{
    Destroy();
}

AudioWorld& AudioWorld::Inst()
{
    static AudioWorld res;
    return res;
}


